/**
* Created with IntelliJ IDEA.
* Description:
* User: LIUYANJIAO
* Date: 2024-09-24
* Time: 21:21
*/public class Main {
    //静态方法只能直接访问静态成员，不需要创建对象
    private static String Name="123";
    private static String Password="222";
    public static void login (String name, String password) throws NameException,PasswordException{
        if(!name.equals(Name)){
            throw new NameException("名字错误");
        }if(!password.equals(Password)){
            throw new PasswordException("密码错误");
        }
    }
    public static void main(String[] args) {
        login("111","222");

//
//        try {
//            login("111","222");
//        }catch (NameException e){
//            e.printStackTrace();
//
//        }catch (PasswordException e){
//            e.printStackTrace();
//
//        }
    }
}